﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="LanMuList.aspx.cs" Inherits="Manager_LanMuList" %>
<%@ Import Namespace="System.Linq" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="Aj.Core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title><%=cid > 0 ? CustomQuery.Category_GetCNameById(cid) : "" %>栏目管理</title>
    <link href="/Manager/css/admin.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" src="/Manager/js/jquery-1.6.1.min.js"></script>
</head>
<body>
    <div class="titlebt"><%=cid > 0 ? CustomQuery.Category_GetCNameById(cid) : "" %>栏目管理</div>
    <div>
        <!--显示列表s-->
        <div id="all">
            <div class="k_all3">
                <table width="100%" cellpadding="0" cellspacing="0" id="bk">
                    <tbody>
                        <tr>
                            <th width="15%">
                                分类名称
                            </th>
                            <th width="15%">
                                栏目名称
                            </th>
                            <th width="15%">
                                显示方式
                            </th>
                            <th width="10%">
                                操作
                            </th>
                        </tr>
                        <% 
                            if (ds != null && ds.Tables.Count > 0)
                            {
                                foreach (DataRow dr in ds.Tables[0].Rows)
                                {
                                    string name = dr["C_Name"].ToString();
                                    string showType = "无配置";
                                    DataSet lmds = CustomQuery.LanMuInfo_GetLanMuInfoByCId(dr["C_Id"].ToInt());
                                    if (lmds != null && lmds.Tables.Count > 0 && lmds.Tables[0].Rows.Count > 0)
                                    {
                                        name = lmds.Tables[0].Rows[0]["LM_Name"].ToString();
                                        showType = string.IsNullOrEmpty(lmds.Tables[0].Rows[0]["LM_SourceUrl"].ToString()) ? "内容显示" : ("<b>外链:</b>" + lmds.Tables[0].Rows[0]["LM_SourceUrl"].ToString());
                                    }
                        %>
                        <tr>
                            <td>
                                <%=dr["C_Name"]%>
                            </td>
                            <td>
                                <%=name%>
                            </td>
                            <td>
                                <%=showType%>
                            </td>
                            <td>
                                <a href="LanMuEdit.aspx?cid=<%=dr["C_Id"]%>" style="color: Black;">[查看与修改]</a>
                                <a href="javascript:;" style="color: Black;" onclick="DeleteInfo('<%=dr["C_Id"]%>')">[删除]</a>
                            </td>
                        </tr>
                        <% 
                                }
                            }            
                        %>
                    </tbody>
                </table>
            </div>
        </div>
        <script type="text/javascript">
            function DeleteInfo(id) {
                if (id != "") {
                    if (confirm("您确定要删除吗？")) {
                        location.href = "LanMuList.aspx?cid=<%=cid %>&d=" + id;
                    }
                }
            }
        </script>
        <!--显示列表e-->
    </div>
</body>
</html>